import { Component } from 'react';
import { connect } from 'dva';
import * as T from '../../models/actionTypes'
class UserPage extends Component {
    constructor(props) {
        super(props);
        this.state = {}
    }
    componentDidMount() {
        const { dispatch } = this.props;
        dispatch({ type: `user/${T.user_query}`, payload: 7 })
    }
    render() {
        console.log(this.props.user);
        return (<div>
            <h2>用户页面</h2>
            <ul>
                {
                    this.props.user.list.map(u => {
                        return <li key={u.id}>{u.id+u.name}</li>
                    })
                }
            </ul>

        </div>);
    }
}
const msp = (s) => {
    return { user: s.user }
}
export default connect(msp)(UserPage);